<template>
	<view>
		<view class="display-a top" v-if="obj.activityType == 2 || obj.activityType == 3">
			<view class="step" :class="step == 1 ? 'two' : 'one'">1</view>
			<view :class="step == 1 ? 'color_6568F6' : 'color_A1A1A1'">活动设置</view>
			<view class="line"></view>
			<view class="step" :class="step == 2 ? 'two' : 'one'">2</view>
			<view :class="step == 2 ? 'color_6568F6' : 'color_A1A1A1'">奖品设置</view>
		</view>

		<block v-if="step == 1">

			<view class="tabs">
				<block v-for="(item,index) in arr" :key="index">
					<view @click="selTab(item.id)" class="uni-tab-item-title"
						:class="obj.releaseChannel == item.id ? 'uni-tab-item-title-active' : ''">{{item.name}}</view>
				</block>
			</view>

			<view class="list-public" style="padding: 24rpx;">
				<input type="text" v-model="obj.activityName" class="input-box p-bo" placeholder="请输入活动名称"
					placeholder-class="placeholder" />
				<textarea placeholder="请输入活动说明~" v-model="obj.activityDescription"
					placeholder-class="placeholder"></textarea>
				<!-- <sunui-upimg2 :uploadServerUrl="upPicUrl" :formData="formData" ref="selectimgandupload2" btnName="上传背景图"
					@uploaded="imgLoaded2" @change="imgsChange2" :maxFileNumber="1"></sunui-upimg2> -->
				<block v-if="obj.activityType == 2 || obj.activityType == 3 || obj.activityType == 5">
					<view class="padding_30rpx_0">活动展示<span class="must">*</span></view>
					<view class="display-a">
						<image class="img-17" @click="selActivityType(2)"
							:src="obj.activityType == 2 ? '../../static/18.png' : '../../static/17.png'"></image>
						<view @click="selActivityType(2)" style="margin-right: 46rpx;">幸运大转盘</view>
						<image class="img-17" @click="selActivityType(3)"
							:src="obj.activityType == 3 ? '../../static/18.png' : '../../static/17.png'"></image>
						<view @click="selActivityType(3)" style="margin-right: 46rpx;">幸运九宫格</view>
						<image class="img-17" @click="selActivityType(5)"
							:src="obj.activityType == 5 ? '../../static/18.png' : '../../static/17.png'"></image>
						<view @click="selActivityType(5)">线下抽奖</view>
					</view>
				</block>
				<block v-if="obj.activityType == 4">
					<view class="padding_30rpx_0">卡券类型<span class="must">*</span></view>
					<view class="display-a">
						<image class="img-17" @click="selCardType(1)"
							:src="obj.cardsettings.cardType == 1 ? '../../static/18.png' : '../../static/17.png'">
						</image>
						<view @click="selCardType(1)" style="margin-right: 36rpx;">折扣券</view>
						<image class="img-17" @click="selCardType(2)"
							:src="obj.cardsettings.cardType == 2 ? '../../static/18.png' : '../../static/17.png'">
						</image>
						<view @click="selCardType(2)" style="margin-right: 36rpx;">满减券</view>
						<image class="img-17" @click="selCardType(3)"
							:src="obj.cardsettings.cardType == 3 ? '../../static/18.png' : '../../static/17.png'">
						</image>
						<view @click="selCardType(3)" style="margin-right: 36rpx;">礼品券</view>
						<image class="img-17" @click="selCardType(4)"
							:src="obj.cardsettings.cardType == 4 ? '../../static/18.png' : '../../static/17.png'">
						</image>
						<view @click="selCardType(4)">红包券</view>
					</view>
				</block>
			</view>

			<view v-if="obj.activityType == 4" class="list-public" style="padding: 32rpx 40rpx;">
				<view class="display-a-js margin-bottom_30rpx">
					<view>发布数量<span class="must">*</span></view>
					<input type="number" v-model="obj.cardsettings.numberOfReleases" class="input-frame"
						placeholder="输入发布数量" placeholder-class="placeholder" />
				</view>
				<view class="display-a-js margin-bottom_30rpx">
					<view>每人每日可领<span class="must">*</span></view>
					<input type="number" v-model="obj.cardsettings.dailyAvailability" class="input-frame"
						placeholder="输入每人一天可领取数量" placeholder-class="placeholder" />
				</view>
				<view class="display-a-js margin-bottom_30rpx">
					<view>每人限领取<span class="must">*</span></view>
					<input type="number" v-model="obj.cardsettings.perPersonLimit" class="input-frame"
						placeholder="输入每人限领取" placeholder-class="placeholder" />
				</view>
				<view class="display-a-js margin-bottom_30rpx">
					<view>活动有效期<span class="must">*</span></view>
					<picker mode="date" :value="dateSta" :start="startDate" :end="user.prescription"
						@change="bindDateChange">
						<view class="display-a-js input-frame" style="width: 422rpx;">
							<input type="text" v-model="obj.cardsettings.validTime" class="sel-date" disabled
								placeholder="选择活动有效期时间" placeholder-class="placeholder" />
							<image class="img-19" src="../../static/19.png"></image>
						</view>
					</picker>
				</view>
				<view class="display-a-js margin-bottom_30rpx">
					<view>核销开始时间<span class="must">*</span></view>
					<picker mode="date" :value="dateSta" :start="''" :end="''" @change="bindDateChange2">
						<view class="display-a-js input-frame" style="width: 422rpx;">
							<input type="text" v-model="obj.cardsettings.writeOffTime" class="sel-date" disabled
								placeholder="选择核销开始时间" placeholder-class="placeholder" />
							<image class="img-19" src="../../static/19.png"></image>
						</view>
					</picker>
				</view>
				<view class="display-a-js">
					<view>核销结束时间<span class="must">*</span></view>
					<picker mode="date" :value="obj.cardsettings.writeOffTime" :start="obj.cardsettings.writeOffTime"
						:end="''" @change="bindDateChange3">
						<view class="display-a-js input-frame" style="width: 422rpx;">
							<input type="text" v-model="obj.cardsettings.checkEndTime" class="sel-date" disabled
								placeholder="选择核销结束时间" placeholder-class="placeholder" />
							<image class="img-19" src="../../static/19.png"></image>
						</view>
					</picker>
				</view>
			</view>

			<view class="list-public" v-if="obj.activityType == 5" style="padding: 36rpx 24rpx;">
				<view class="margin-bottom_30rpx">选择设备<span class="must">*</span></view>
				<picker mode="selector" @change="bindPickerChange4" :range="deviceList" :range-key="'equipmentName'">
					<view class="display-a sel-input margin-bottom_40rpx">
						<input disabled placeholder="请选择设备" v-model="obj.equipmentName"
							placeholder-class="placeholder" />
						<image class="img-19" src="../../static/19.png"></image>
					</view>
				</picker>
			</view>

			<view v-if="(obj.activityType == 1 && obj.releaseChannel != 2) || obj.activityType == 5" class="list-public" style="padding: 32rpx 40rpx;margin: 20rpx;">
				<view class="display-a-js margin-bottom_30rpx" @click="getAuth()" v-if="obj.activityType == 1 && obj.releaseChannel == 1">
					<view>是否开启D音授权</view>
					<image class="img-43" v-if="obj.authorizedNot == 1" src="../../static/43.png"></image>
					<image class="img-43" v-if="obj.authorizedNot == 2" src="../../static/44.jpg"></image>
				</view>
				<block v-if="obj.authorizedNot != 1">
					<view class="display-a-js margin-bottom_30rpx">
						<view>每人每日可领<span class="must">*</span></view>
						<input type="number" v-model="obj.dailyAvailability" class="input-frame" placeholder="输入每人一天可领取数量"
							placeholder-class="placeholder" />
					</view>
					<view :class="obj.activityType == 1 ? 'display-a-js' : 'display-a-js margin-bottom_30rpx'">
						<view>每人限领取<span class="must">*</span></view>
						<input type="number" v-model="obj.perPerson" class="input-frame" placeholder="输入每人限领取"
							placeholder-class="placeholder" />
					</view>
				</block>
				<view :class="obj.activityType == 5 ? 'display-a-js' : 'display-a-js margin-bottom_30rpx'" v-if="obj.activityType == 5">
					<view>活动有效期<span class="must">*</span></view>
					<picker mode="date" :value="dateSta" :start="startDate" :end="user.prescription"
						@change="bindDateChange4">
						<view class="display-a-js input-frame" style="width: 422rpx;">
							<input type="text" v-model="obj.validTime" class="sel-date" disabled placeholder="选择活动有效期时间"
								placeholder-class="placeholder" />
							<image class="img-19" src="../../static/19.png"></image>
						</view>
					</picker>
				</view>
			</view>

			<view class="list-public" style="padding: 36rpx 24rpx;">

				<!-- <view class="margin-bottom_30rpx">剪辑类型<span class="must">*</span></view>
				<view class="display-a margin-bottom_40rpx">
					<image class="img-17" @click="selClipType(1)"
						:src="obj.clipType == 1 ? '../../static/18.png' : '../../static/17.png'"></image>
					<view style="margin-right: 84rpx;" @click="selClipType(1)">AI剪辑</view>
					<image class="img-17" @click="selClipType(2)"
						:src="obj.clipType == 2 ? '../../static/18.png' : '../../static/17.png'"></image>
					<view style="margin-right: 84rpx;" @click="selClipType(2)">口播剪辑</view>
					<image class="img-17" @click="selClipType(3)"
						:src="obj.clipType == 3 ? '../../static/18.png' : '../../static/17.png'"></image>
					<view @click="selClipType(3)">图文剪辑</view>
				</view> -->

				<view class="margin-bottom_30rpx">剪辑任务<span class="must">*</span></view>
				<picker mode="selector" :disabled="obj.id ? true : false" @change="bindPickerChange" :range="videoList"
					:range-key="'name'">
					<view class="display-a sel-input margin-bottom_40rpx">
						<input disabled placeholder="请选择视频素材" v-model="obj.videoMaterial"
							placeholder-class="placeholder" />
						<image v-if="!obj.id" class="img-19" src="../../static/19.png"></image>
					</view>
				</picker>

				<!-- <view class="display-a-js margin-bottom_30rpx" v-if="obj.videoMaterial">
					<view>视频剪辑数量<span class="must">*</span></view>
					<input type="number" :disabled="obj.id ? true : false" @blur="getInput" v-model="getNumber"
						class="input-frame" placeholder="视频剪辑数量" placeholder-class="placeholder" />
				</view> -->

				<view class="margin-bottom_30rpx">SEO文案<span class="must">*</span></view>
				<picker mode="selector" @change="bindPickerChange2" :range="seoList" :range-key="'taticsName'">
					<view class="display-a sel-input margin-bottom_40rpx">
						<input disabled placeholder="请选择文案" v-model="obj.seoCopywriting"
							placeholder-class="placeholder" />
						<image class="img-19" src="../../static/19.png"></image>
					</view>
				</picker>
				<view v-if='obj.releaseChannel==1'>
					<view class="margin-bottom_30rpx">发布设置<span class="must">*</span></view>
					<view class="display-a margin-bottom_40rpx">
						<image class="img-17" @click="publishSetting(0)"
							:src="obj.shareToPublish == 0 ? '../../static/18.png' : '../../static/17.png'"></image>
						<view style="margin-right: 84rpx;" @click="publishSetting(0)">跳转到剪辑页</view>
						<image class="img-17" @click="publishSetting(1)"
							:src="obj.shareToPublish == 1 ? '../../static/18.png' : '../../static/17.png'"></image>
						<view style="margin-right: 84rpx;" @click="publishSetting(1)">跳转到发布页</view>
					</view>
				</view>
				<view class="margin-bottom_30rpx">{{obj.releaseChannel == 3 ? '挂载小黄车' : '挂载类型'}}</view>
				<block v-if="obj.releaseChannel == 1">
					<view class="display-a margin-bottom_30rpx">
						<image class="img-17" @click="selMountType(1)"
							:src="obj.mountType == 1 ? '../../static/18.png' : '../../static/17.png'"></image>
						<view style="margin-right: 88rpx;" @click="selMountType(1)">商家POI</view>
						<image class="img-17" @click="selMountType(2)"
							:src="obj.mountType == 2 ? '../../static/18.png' : '../../static/17.png'"></image>
						<view style="margin-right: 88rpx;" @click="selMountType(2)">小程序</view>
						<image class="img-17" @click="selMountType(3)"
							:src="obj.mountType == 3 ? '../../static/18.png' : '../../static/17.png'"></image>
						<view @click="selMountType(3)">不挂载</view>
					</view>
					<block v-if="obj.mountType == 1">
						<view class="display-a-js margin-bottom_30rpx">
							<view>选择城市<span class="must">*</span></view>
							<view class="display-a-js input-frame" style="width: 500rpx;" @click="handleRegion()">
								<input type="text" v-model="obj.cityName" class="sel-date" disabled placeholder="请先选择城市"
									placeholder-class="placeholder" />
								<image class="img-19" src="../../static/19.png"></image>
							</view>
						</view>
						<view class="display-a-js margin-bottom_30rpx">
							<view>商家简称<span class="must">*</span></view>
							<view class="display-a-js input-frame" style="width: 500rpx;padding: 0 0 0 26rpx;">
								<input type="text" class="sel-date" v-model="obj.merchantAbbreviation"
									placeholder="请输入商家简称搜索POI地址" placeholder-class="placeholder" />
								<view class="search" @click="getPoiList()">搜索</view>
							</view>
						</view>
						<view class="display-a-js">
							<view>POI地址<span class="must">*</span></view>
							<picker mode="selector" @change="bindPickerChange3" :range="poiList"
								:range-key="'poi_name'">
								<view class="display-a-js input-frame" style="width: 500rpx;">
									<input type="text" class="sel-date" v-model="obj.poiName" disabled
										placeholder="请选择POI地址" placeholder-class="placeholder" />
									<image class="img-19" src="../../static/19.png"></image>
								</view>
							</picker>
						</view>
					</block>
					<block v-if="obj.mountType == 2">
						<view class="display-a-js margin-bottom_30rpx">
							<view class="font-size_26rpx">D音小程序APPID<span class="must">*</span></view>
							<input type="text" class="input-frame" v-model="obj.appId" placeholder="D音小程序APPID"
								placeholder-class="placeholder" />
						</view>
						<view class="display-a-js margin-bottom_30rpx">
							<view class="font-size_26rpx">D音小程序名称<span class="must">*</span></view>
							<input type="number" class="input-frame" v-model="obj.appTitle" placeholder="D音小程序名称"
								placeholder-class="placeholder" />
						</view>
						<view class="display-a-js">
							<view class="font-size_26rpx">D音小程序URL<span class="must">*</span></view>
							<input type="number" class="input-frame" v-model="obj.appUrl" placeholder="D音小程序URL"
								placeholder-class="placeholder" />
						</view>
					</block>
				</block>
				<block v-if="obj.releaseChannel == 2">
					<view class="display-a margin-bottom_30rpx">
						<image class="img-17" @click="selSphMountType(1)"
							:src="obj.sphMountType == 1 ? '../../static/18.png' : '../../static/17.png'"></image>
						<view style="margin-right: 20rpx;" @click="selSphMountType(1)">公众号文章</view>
						<image class="img-17" @click="selSphMountType(2)"
							:src="obj.sphMountType == 2 ? '../../static/18.png' : '../../static/17.png'"></image>
						<view style="margin-right: 20rpx;" @click="selSphMountType(2)">红包封面</view>
						<image class="img-17" @click="selSphMountType(3)"
							:src="obj.sphMountType == 3 ? '../../static/18.png' : '../../static/17.png'"></image>
						<view style="margin-right: 20rpx;" @click="selSphMountType(3)">标签</view>
						<image class="img-17" @click="selSphMountType(4)"
							:src="obj.sphMountType == 4 ? '../../static/18.png' : '../../static/17.png'"></image>
						<view @click="selSphMountType(4)">不挂载</view>
					</view>
					<view class="display-a-js" v-if="obj.sphMountType != 4">
						<view>{{obj.sphMountType == 1 ? '公众号文章URL' : obj.sphMountType == 2 ? '红包封面URL' : '标签URL'}}<span
								class="must">*</span></view>
						<input type="text" class="input-frame" placeholder="请输入挂载URL链接"
							placeholder-class="placeholder" />
					</view>
				</block>
				<view class="display-a-js margin-bottom_30rpx" v-if="obj.releaseChannel == 3">
					<view>小黄车ID</view>
					<input type="text" class="input-frame" placeholder="请输入K手小黄车ID" placeholder-class="placeholder" />
				</view>
				<block v-if="user.applymentState == 2">
					<view class="display-a-js margin-top_30rpx" @click="getPay()" v-if="obj.releaseChannel == 1">
						<view>是否开启do支付</view>
						<image class="img-43" v-if="obj.douPayNot == 2" src="../../static/43.png"></image>
						<image class="img-43" v-if="obj.douPayNot == 1" src="../../static/44.jpg"></image>
					</view>
				</block>
			</view>

			<view style="height: 214rpx;"></view>

			<view class="bott">
				<!-- <view class="text-align_center margin-bottom_30rpx">视频最大剪辑数量 <span
						class="color_6568F6 margin-left_10rpx"> {{obj.editingNumber ? obj.editingNumber : 0}}个</span>
				</view> -->
				<view class="but" @click="but()"
					v-if="obj.activityType == 1 || obj.activityType == 4 || obj.activityType == 5">发布活动</view>
				<view class="but" @click="next(1)" v-if="obj.activityType == 2 || obj.activityType == 3">下一步</view>
			</view>

		</block>

		<block v-if="step == 2">

			<view class="list-public" style="padding: 32rpx 40rpx;margin: 20rpx;">
				<view class="display-a-js margin-bottom_30rpx">
					<view>每人每日可领<span class="must">*</span></view>
					<input type="number" v-model="obj.dailyAvailability" class="input-frame" placeholder="输入每人一天可领取数量"
						placeholder-class="placeholder" />
				</view>
				<view class="display-a-js margin-bottom_30rpx">
					<view>每人限领取<span class="must">*</span></view>
					<input type="number" v-model="obj.perPerson" class="input-frame" placeholder="输入每人限领取"
						placeholder-class="placeholder" />
				</view>
				<view :class="obj.activityType == 5 ? 'display-a-js' : 'display-a-js margin-bottom_30rpx'">
					<view>活动有效期<span class="must">*</span></view>
					<picker mode="date" :value="dateSta" :start="startDate" :end="user.prescription"
						@change="bindDateChange4">
						<view class="display-a-js input-frame" style="width: 422rpx;">
							<input type="text" v-model="obj.validTime" class="sel-date" disabled placeholder="选择活动有效期时间"
								placeholder-class="placeholder" />
							<image class="img-19" src="../../static/19.png"></image>
						</view>
					</picker>
				</view>
				<view class="display-a-js margin-bottom_30rpx">
					<view>核销开始时间<span class="must">*</span></view>
					<picker mode="date" :value="dateSta" :start="''" :end="''" @change="bindDateChange5">
						<view class="display-a-js input-frame" style="width: 422rpx;">
							<input type="text" v-model="obj.writeOffTime" class="sel-date" disabled
								placeholder="选择核销开始时间" placeholder-class="placeholder" />
							<image class="img-19" src="../../static/19.png"></image>
						</view>
					</picker>
				</view>
				<view class="display-a-js">
					<view>核销结束时间<span class="must">*</span></view>
					<picker mode="date" :value="obj.writeOffTime" :start="obj.writeOffTime" :end="''"
						@change="bindDateChange6">
						<view class="display-a-js input-frame" style="width: 422rpx;">
							<input type="text" v-model="obj.checkEndTime" class="sel-date" disabled
								placeholder="选择核销结束时间" placeholder-class="placeholder" />
							<image class="img-19" src="../../static/19.png"></image>
						</view>
					</picker>
				</view>
			</view>

			<view class="list-public" style="padding: 32rpx;" v-if="obj.activityType == 2 || obj.activityType == 3">
				<view class="margin-bottom_20rpx">{{obj.activityType == 2 ? '大转盘' : '九宫格'}}奖品列表设置<span
						class="must">*</span></view>
				<block v-for="(item,index) in obj.listofprizes" :key="index">
					<view class="display-a-js padding-top_30rpx">
						<view>
							<view><span class="sort">{{index+1}}</span>奖品名称<span class="must">*</span></view>
							<input type="text" class="input-name" v-model="item.prizeName" placeholder="请输入奖品名称"
								placeholder-class="placeholder" />
						</view>
						<!-- <sunui-upimg2 :uploadServerUrl="upPicUrl" :formData="formData" ref="selectimgandupload2" btnName="奖品图"
							@uploaded="imgLoaded2" @change="imgsChange2" :maxFileNumber="1"></sunui-upimg2> -->
					</view>
					<view class="display-a" :class="index == 5 ? 'padding-top_30rpx' : 'padding_30rpx_0 p-bo'">
						<view class="text-align_center" style="margin-right: 50rpx;">
							<view>奖品数量<span class="must">*</span></view>
							<input type="number" v-model="item.quantity" class="input-number" placeholder="奖品数量"
								placeholder-class="placeholder" />
						</view>
						<view class="text-align_center" style="margin-right: 50rpx;">
							<view class="font-size_26rpx">每人可中次数<span class="must">*</span></view>
							<input type="number" v-model="item.medianFrequency" class="input-number" placeholder="可中次数"
								placeholder-class="placeholder" />
						</view>
						<view class="text-align_center">
							<view>中奖率%<span class="must">*</span></view>
							<input type="digit" v-model="item.winningPercentage" class="input-number" placeholder="中奖率%"
								placeholder-class="placeholder" />
						</view>
					</view>
				</block>
			</view>

			<view style="height: 150rpx;"></view>

			<view class="bott display-a-js">
				<view class="back-next" @click="next(2)">上一步</view>
				<view class="but" style="width: 370rpx;" @click="but()">发布活动</view>
			</view>
		</block>

		<lb-picker ref="picker2" v-model="value2" mode="multiSelector" confirmColor="#6568F6" :list="regionList"
			:props="factoryProp" :level="2" @change="handleChange" @confirm="handleConfirm" @cancel="handleCancel">
			<template>
				<view slot="action-center">选择城市</view>
			</template>
		</lb-picker>

	</view>
</template>

<script>
	const base64 = require('@/utils/ali-oos/base64.js'); //Base64,hmac,sha1,crypto相关算法
	require('@/utils/ali-oos/hmac.js');
	require('@/utils/ali-oos/sha1.js');
	const Crypto = require('@/utils/ali-oos/crypto.js');
	import regionList from '@/utils/region-picker.js';
	export default {
		data() {
			return {
				step: 1, //1第一步 2第二步

				arr: [{
						id: 1,
						name: 'D音'
					},
					{
						id: 2,
						name: '视频号'
					},
					{
						id: 3,
						name: 'K手'
					},
				],

				value2: [],
				regionList: regionList.zones_tree,
				factoryProp: {
					label: 'name',
					value: 'id'
				},

				obj: {
					id: '',
					activityType: '', //活动类型 1.视频快推2.幸运大转盘3.幸运九宫格4.卡劵活动 5硬件活动
					activityName: '', //活动名称
					activityDescription: '', //活动说明
					backgroundImage: '', //背景图
					clipType: 1, //剪辑类型 1.AI剪辑 2.口播剪辑 3.图文剪辑
					videoMaterial: '', //视频素材
					videoMaterialId: '', //视频素材ID
					editingNumber: '', //视频剪辑数量
					seoCopywriting: '', //seo文案
					seoCopywritingId: '', //seo文案ID
					equipmentId: '', //设备ID
					equipmentName: '', //设备名称
					releaseChannel: 1, //发布渠道 1.抖音2.视频号3.快手
					mountType: 3, //挂载类型1.商家POI 2.抖音小程序 3.不挂载
					poiId: '', //商家POI Id
					poiName: '', //POI地址名称
					city: '', //城市CODE
					cityName: '', //城市
					merchantAbbreviation: '', //商家简称
					appId: '', //抖音小程序APPID
					appTitle: '', //抖音小程序标题
					appUrl: '', //抖音小程序Url地址
					description: '', //抖音小程序描述
					littleYellowCarId: '', //小黄车ID
					sphMountType: 4, //视频号挂载类型1.公众号文章 2.红包封面 3.标签 4.不挂载
					sphLink: '', //视频号挂载链接
					douPayNot: 2, //1开启 2关闭
					authorizedNot: 1, // 1不授权 2需要授权
					dailyAvailability: '', //每人每日可领取
					perPerson: '', //每人限领取
					validTime: '', //有效时间
					writeOffTime: '', //核销开始时间
					checkEndTime: '', //核销结束时间
					shareToPublish: 0, //0是编辑页 1是抖音发布页
					listofprizes: [{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
					], //奖品列表
					cardsettings: {
						cardType: 1, //卡劵类型 1折扣 2满减 3礼品 4红包
						numberOfReleases: '', //发布数量
						perPersonLimit: '', //每人限领取
						validTime: '', //有效时间
						dailyAvailability: '', //每人每日可领取
						writeOffTime: '', //核销开始时间
						checkEndTime: '', //核销结束时间
					},
				},

				getNumber: '',

				dateSta: '',

				videoList: [], //视频素材
				seoList: [], //seo文案
				poiList: [],
				deviceList: [], //设备列表

				formData: {
					'key': '',
					'policy': '',
					'OSSAccessKeyId': '',
					'signature': '',
					'success_action_status': '200',
				},

				policyText: {
					"expiration": "2030-01-01T12:00:00.000Z", //设置该Policy的失效时间，超过这个失效时间之后，就没有办法通过这个policy上传文件了
					"conditions": [
						["content-length-range", 0, 104857600] // 设置上传文件的大小限制
					]
				},

				upPicUrl: '',

				user: {},

			}
		},

		computed: {
			startDate() {
				return this.getDate('start');
			},
			endDate() {
				return this.getDate('end');
			}
		},

		onLoad(options) {

			this.dateSta = this.getDate("end");
			if (uni.getStorageSync('merchantCode')) {
				this.set();
				this.getSeoPage();
				this.getProjectPage();
			}
			if (uni.getStorageSync('merchantId')) {
				this.getInfo();
				this.getEquipmentPage();
			}
			if (options.id) {
				this.obj.id = options.id;
				this.detail();

				// 这个地方是编辑页面 就在这进行判断是否又视频号
				//类型为 3 4 5 我们就不需要显示出视频号 

				if (options.type == 3 || options.type == 4 || options.type == 5) {
					const index = this.arr.findIndex((item) => {
						return item.name == '视频号'
					})
					if (index !== -1) {

						console.log(index)
						this.arr.splice(1, index)
					}
				}

			}
			if (options.type) {
				this.obj.activityType = options.type;
				// 在这里
				if (Number(this.obj.activityType) == 2) {

					// 隐藏

					const index = this.arr.findIndex((item) => {
						return item.name == '视频号'
					})
					if (index !== -1) {

						console.log(index)
						this.arr.splice(1, index)
					}

				}


				if (this.obj.activityType == 1) {
					this.$sun.title("视频快推");
				}
				if (this.obj.activityType == 2) {
					this.$sun.title("幸运抽奖");
					this.step = 1;
				}
				if (this.obj.activityType == 4) {
					this.$sun.title("发布卡券");
				}
			}

			// 如果是2 和 3 那么我们就 不需要显示视频号
			if (this.obj.activityType == 4) {
				// 隐藏
				console.log(this.arr)
				const index = this.arr.findIndex((item) => {
					return item.name == '视频号'
				})
				if (index !== -1) {

					console.log(index)
					this.arr.splice(1, index)
				}

			}
		},

		onShow() {
			this.$at.releaseKey('release');

		},

		methods: {
			
			getAuth() {
				if (this.obj.id) {
					this.$sun.toast("编辑活动不能修改是否授权", 'none');
					return;
				}
				this.obj.authorizedNot = this.obj.authorizedNot == 1 ? 2 : 1;
			},
			
			getPay() {
				
				if (this.obj.id) {
					this.$sun.toast("编辑活动不能修改do支付", 'none');
					return;
				}
				
				if (this.obj.douPayNot == 1) {
					this.obj.douPayNot = 2;
					return;
				}
				if (this.obj.douPayNot == 2) {
					this.obj.douPayNot = 1;
				}
			},
			
			//活动详情
			async detail() {
				const result = await this.$http.get({
					url: this.$api.selectGetId,
					data: {
						id: this.obj.id,
					}
				});
				if (result.code == 2000) {
					this.obj = result.data;
					// this.getNumber = this.obj.editingNumber;
				} else {
					this.$sun.toast(result.msg, 'none');
				}
			},

			//发布活动
			but() {

				/* if (this.obj.editingNumber == 0) {
					this.$sun.toast("可剪辑视频数量不足,请重选剪辑任务", "none");
					return;
				} */

				if (!this.obj.activityName) {
					this.$sun.toast("请输入活动名称", "none");
					return;
				}

				if (!this.obj.activityDescription) {
					this.$sun.toast("请输入活动明细", "none");

					return;
				}

				// if (!this.obj.backgroundImage) {
				// 	this.$sun.toast("请上传海报图", "none");
				// 	return;
				// }

				//线下抽奖
				if (this.obj.activityType == 5) {
					if (!this.obj.equipmentId) {
						this.$sun.toast("请选择一个设备", "none");
						return;
					}
					if (!this.obj.dailyAvailability) {
						this.$sun.toast("请输入每人每日可领取数量", "none");
						return;
					}
					if (!this.obj.perPerson) {
						this.$sun.toast("请输入每人限领取数量", "none");
						return;
					}
					if (!this.obj.validTime) {
						this.$sun.toast("请选择卡券活动有效时间", "none");
						return;
					}
				}
				
				//抖音直推
				if (this.obj.activityType == 1 && this.obj.authorizedNot == 2) {
					if (!this.obj.dailyAvailability) {
						this.$sun.toast("请输入每人每日可领取数量", "none");
						return;
					}
					if (!this.obj.perPerson) {
						this.$sun.toast("请输入每人限领取数量", "none");
						return;
					}
				}

				//卡券活动
				if (this.obj.activityType == 4) {
					if (!this.obj.cardsettings.numberOfReleases) {
						this.$sun.toast("请输入卡券发布数量", "none");
						return;
					}
					if (!this.obj.cardsettings.dailyAvailability) {
						this.$sun.toast("请输入每人每日可领取数量", "none");
						return;
					}
					if (!this.obj.cardsettings.perPersonLimit) {
						this.$sun.toast("请输入每人限领取数量", "none");
						return;
					}
					if (!this.obj.cardsettings.validTime) {
						this.$sun.toast("请选择卡券活动有效时间", "none");
						return;
					}
					if (!this.obj.cardsettings.writeOffTime) {
						this.$sun.toast("请选择卡券核销开始时间", "none");
						return;
					}
					if (!this.obj.cardsettings.checkEndTime) {
						this.$sun.toast("请选择卡券核销结束时间", "none");
						return;
					}
				}

				if (!this.obj.videoMaterialId) {
					this.$sun.toast("请选择剪辑任务", "none");
					return;
				}

				/* if (!this.getNumber) {
					this.$sun.toast("请输入剪辑视频数量", "none");
					return;
				} */

				if (!this.obj.seoCopywritingId) {
					this.$sun.toast("请选择SEO文案", "none");
					return;
				}

				//POI挂载
				if (this.obj.releaseChannel == 1 && this.obj.mountType == 1) {
					if (!this.obj.city) {
						this.$sun.toast("请选择城市", "none");
						return;
					}
					if (!this.obj.merchantAbbreviation) {
						this.$sun.toast("请输入商家简称", "none");
						return;
					}
					if (!this.obj.poiId) {
						this.$sun.toast("请选择POI地址", "none");
						return;
					}
				}

				//抖音挂载
				if (this.obj.releaseChannel == 1 && this.obj.mountType == 2) {
					if (!this.obj.appId) {
						this.$sun.toast("请输入D音小程序APPID", "none");
						return;
					}
					if (!this.obj.appTitle) {
						this.$sun.toast("请输入D音小程序名称", "none");
						return;
					}
					if (!this.obj.appUrl) {
						this.$sun.toast("请输入D音小程序URL", "none");
						return;
					}
				}

				//视频号挂载
				if (this.obj.releaseChannel == 2 && this.obj.sphMountType != 4) {
					if (!this.obj.sphLink) {
						this.$sun.toast("请输入视频号挂载URL链接", "none");
						return;
					}
				}

				//大转盘 九宫格
				if (this.step == 2 && (this.obj.activityType == 2 || this.obj.activityType == 3)) {
					if (!this.obj.dailyAvailability) {
						this.$sun.toast("请输入每人每日可领取数量", "none");
						return;
					}
					if (!this.obj.perPerson) {
						this.$sun.toast("请输入每人限领取数量", "none");
						return;
					}
					if (!this.obj.validTime) {
						this.$sun.toast("请选择卡券活动有效时间", "none");
						return;
					}
					if (!this.obj.writeOffTime) {
						this.$sun.toast("请选择卡券核销开始时间", "none");
						return;
					}
					if (!this.obj.checkEndTime) {
						this.$sun.toast("请选择卡券核销结束时间", "none");
						return;
					}

					for (let i = 0; i < this.obj.listofprizes.length; i++) {
						if ((!this.obj.listofprizes[i].prizeName) || (!this.obj.listofprizes[i].quantity) || (!this.obj
								.listofprizes[i].winningPercentage) || (!this.obj.listofprizes[i].medianFrequency)) {
							this.$sun.toast("请完善奖品" + (i + 1) + "的信息", 'none');
							return;
						}
					}
				}

				this.$at.uniDoFunc({
					key: 'release',
					success: async () => {
						this.$at.lockKey('release');
						const result = await this.$http.post({
							url: this.$api.releaseIssue,
							data: {
								merchantId: uni.getStorageSync('merchantId'),
								id: this.obj.id,
								activityType: this.obj.activityType, //活动类型 1.视频快推2.幸运大转盘3.幸运九宫格4.卡劵活动 5硬件活动
								activityName: this.obj.activityName, //活动名称
								activityDescription: this.obj.activityDescription, //活动说明
								backgroundImage: this.obj.backgroundImage, //背景图
								clipType: this.obj.clipType, //剪辑类型 1.AI剪辑 2.口播剪辑 3.图文剪辑
								videoMaterial: this.obj.videoMaterial, //视频素材
								videoMaterialId: this.obj.videoMaterialId, //视频素材ID
								// editingNumber: this.getNumber, //视频剪辑数量
								seoCopywriting: this.obj.seoCopywriting, //seo文案
								seoCopywritingId: this.obj.seoCopywritingId, //seo文案ID
								equipmentId: this.obj.equipmentId, //设备ID
								equipmentName: this.obj.equipmentName, //设备名称
								releaseChannel: this.obj.releaseChannel, //发布渠道 1.抖音2.视频号3.快手
								mountType: this.obj.mountType, //挂载类型1.商家POI 2.抖音小程序 3.不挂载
								poiId: this.obj.poiId, //商家POI Id
								poiName: this.obj.poiName, //POI地址名称
								city: this.obj.city, //城市CODE
								douPayNot: this.obj.douPayNot,
								authorizedNot: this.obj.releaseChannel == 1 ? this.obj.activityType == 1 ? this.obj.authorizedNot : '' : '', //1不授权 2授权
								cityName: this.obj.cityName, //城市
								merchantAbbreviation: this.obj.merchantAbbreviation, //商家简称
								appId: this.obj.appId, //抖音小程序APPID
								appTitle: this.obj.appTitle, //抖音小程序标题
								appUrl: this.obj.appUrl, //抖音小程序Url地址
								description: this.obj.description, //抖音小程序描述
								littleYellowCarId: this.obj.littleYellowCarId, //小黄车ID
								sphMountType: this.obj.sphMountType, //视频号挂载类型1.公众号文章 2.红包封面 3.标签 4.不挂载
								sphLink: this.obj.sphLink, //视频号挂载链接
								dailyAvailability: this.obj.dailyAvailability, //每人每日可领取
								perPerson: this.obj.perPerson, //每人限领取
								validTime: this.obj.validTime, //有效时间
								writeOffTime: this.obj.writeOffTime, //核销开始时间
								checkEndTime: this.obj.checkEndTime, //核销结束时间
								listofprizes: this.obj.listofprizes,
								cardsettings: this.obj.cardsettings,
								platformType: 1, //1移动端 2PC端
								shareToPublish: this.obj.shareToPublish //0是编辑页 1是抖音发布页
							}
						});
						if (result.code == 2000) {
							this.$at.releaseKey('release');
							uni.showModal({
								content: '活动发布成功',
								showCancel: false,
								confirmText: '确定',
								success() {
									uni.navigateBack();
								}
							})
						} else {
							this.$sun.toast(result.msg, "none");
							this.$at.releaseKey('release');
						}
					}
				});
			},

			//poi列表
			async getPoiList() {

				if (!this.obj.city) {
					this.$sun.toast("请选择城市", 'none');
					return;
				}

				if (!this.obj.merchantAbbreviation) {
					this.$sun.toast("请输入商家简称", 'none');
					return;
				}

				const result = await this.$http.get({
					url: this.$api.getPoi,
					data: {
						keyword: this.obj.merchantAbbreviation,
						city: this.obj.city
					}
				});
				if (result.code == 2000) {
					this.poiList = result.data.data.pois;
				} else {
					this.$sun.toast(result.msg, 'none');
				}
			},

			handleRegion() {
				this.$refs['picker2'].show();
			},

			//幸运抽奖类型
			selActivityType(type) {
				console.log(type)
				// 如果是2 和 3 那么我们就 不需要显示视频号
				if (type == 2 || type == 3) {
					// 隐藏
					console.log(this.arr)
					const index = this.arr.findIndex((item) => {
						return item.name == '视频号'
					})
					if (index !== -1) {

						console.log(index)
						this.arr.splice(1, index)
					}

				}
				if (type == 5) {
					// 需要显示除视频号
					const index = this.arr.findIndex((item) => {
						return item.name == '视频号'
					})
					console.log(index)
					if (index == -1) {
						this.arr.splice(1, 0, {
							id: 2,
							name: '视频号'
						});
					}
				}
				if (this.obj.id) {
					this.$sun.toast("编辑活动不能修改活动展示", 'none');
					return;
				}

				this.obj.activityType = type;
				if (this.obj.activityType == 2) {
					this.obj.listofprizes = [{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
					];
				}
				if (this.obj.activityType == 3) {
					this.obj.listofprizes = [{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
						{
							prizeName: '', //奖品名称
							prizePicture: '', //奖品图片
							quantity: '', //数量
							winningPercentage: '', //中奖率
							medianFrequency: '', //用户可中次数
						},
					];
				}
			},

			//卡券类型
			selCardType(type) {


				if (this.obj.id) {
					this.$sun.toast("编辑活动不能修改卡券类型", 'none');
					return;
				}

				this.obj.cardsettings.cardType = type;
			},

			//选择城市
			handleChange(e) {
				console.log(e);
			},
			handleConfirm(e) {
				let index = e.index;

				let firstIndex = index[0];
				let secondIndex = index[1];
				// let thridIndex = index[2];

				// let firstStatus = this.regionList[firstIndex];
				let secondStatus = this.regionList[firstIndex].children[secondIndex];
				// let thridStatus = this.regionList[firstIndex].children[secondIndex].children[thridIndex];
				this.obj.cityName = secondStatus.name;
				this.obj.city = secondStatus.code;

			},
			handleCancel(e) {
				console.log('cancel::', e);
			},

			//设备列表
			async getEquipmentPage() {
				const result = await this.$http.post({
					url: this.$api.equipmentPage,
					data: {
						merchantId: uni.getStorageSync('merchantId')
					}
				});
				if (result.code == 2000) {
					this.deviceList = result.data;
				} else {
					this.$sun.toast(result.msg, 'none');
				}
			},

			//seo文案
			async getSeoPage() {
				const result = await this.$http.post({
					url: this.$api.seoPage,
					data: {
						username: uni.getStorageSync('merchantCode'),
						type: this.obj.releaseChannel
					}
				});
				if (result.code == 2000) {
					this.seoList = result.data;
				} else {
					this.$sun.toast(result.msg, 'none');
				}
			},

			//视频素材
			async getProjectPage() {
				const result = await this.$http.post({
					url: this.$api.projectPage,
					data: {
						username: uni.getStorageSync('merchantCode'),
						// type: this.obj.clipType
					}
				});
				if (result.code == 2000) {
					this.videoList = result.data;
				} else {
					this.$sun.toast(result.msg, 'none');
				}
			},

			//下一步
			next(type) {

				//下一步
				if (type == 1) {
					// if (this.obj.editingNumber == 0) {
					// 	this.$sun.toast("可剪辑视频数量不足,请重选剪辑任务", "none");
					// 	return;
					// }
					this.step = 2;
				}
				//上一步
				if (type == 2) {
					this.step = 1;
				}

			},

			/*  日期选择  */
			bindDateChange(e) {
				this.obj.cardsettings.validTime = e.target.value;
			},
			bindDateChange2(e) {
				this.obj.cardsettings.writeOffTime = e.target.value;
			},
			bindDateChange3(e) {
				this.obj.cardsettings.checkEndTime = e.target.value;
			},
			bindDateChange4(e) {
				this.obj.validTime = e.target.value;
			},
			bindDateChange5(e) {
				this.obj.writeOffTime = e.target.value;
			},
			bindDateChange6(e) {
				this.obj.checkEndTime = e.target.value;
			},

			//剪辑类型
			selClipType(type) {

				if (this.obj.id) {
					this.$sun.toast("编辑活动不能修改剪辑类型", 'none');
					return;
				}

				this.obj.clipType = type;
				this.obj.videoMaterial = ''; //视频素材
				this.obj.videoMaterialId = ''; //视频素材ID
				// this.obj.editingNumber = 0;
				this.getProjectPage();
			},
			// 发布设置

			publishSetting(type) {
				this.$set(this.obj, 'shareToPublish', type);
				// this.obj.share_to_publish = type;

			},
			//输入视频剪辑数量——未使用
			getInput(e) {

				if (!e.detail.value) {
					this.$sun.toast("请输入整数", 'none');
					this.getNumber = '';
					return;
				}

				if (e.detail.value == 0) {
					this.$sun.toast("请输入大于0的整数", 'none');
					this.getNumber = '';
					return;
				}

				let r = /^\+?[1-9][0-9]*$/;

				if (r.test(e.detail.value)) {
					if (Number(e.detail.value) < this.obj.editingNumber) {
						// this.editingNumber = e.detail.value;
						this.getNumber = e.detail.value;
					} else {
						this.$sun.toast("已超出最大剪辑数量", 'none');
						this.getNumber = '';
					}
				} else {
					this.$sun.toast("请输入正确的整数", 'none');
					this.getNumber = '';
				}
			},

			//选择视频素材
			bindPickerChange(e) {
				if (this.obj.id) {
					this.$sun.toast("编辑活动不能修改剪辑任务", 'none');
					return;
				}

				this.obj.videoMaterial = this.videoList[e.detail.value].name; //视频素材
				this.obj.videoMaterialId = this.videoList[e.detail.value].id; //视频素材ID
				// this.obj.editingNumber = this.videoList[e.detail.value].max;
				// this.getNumber = this.videoList[e.detail.value].max;
			},

			//发布渠道
			selTab(id) {

				if (this.obj.id) {
					this.$sun.toast("编辑活动不能修改发布渠道", 'none');
					return;
				}
				
				if (id == 1) {
					this.obj.authorizedNot = 1;
				}else {
					this.obj.authorizedNot = '';
				}
				
				this.obj.douPayNot = 2;
				this.obj.releaseChannel = id;
				this.obj.seoCopywriting = ''; //seo文案
				this.obj.seoCopywritingId = ''; //seo文案ID
				this.getSeoPage();
			},
			//选择SEO文案
			bindPickerChange2(e) {
				this.obj.seoCopywriting = this.seoList[e.detail.value].taticsName; //seo文案
				this.obj.seoCopywritingId = this.seoList[e.detail.value].id; //seo文案ID
			},

			//抖音挂载
			selMountType(type) {
				this.obj.mountType = type;

			},
			//选择POI地址
			bindPickerChange3(e) {
				this.obj.poiId = this.poiList[e.detail.value].poi_id; //商家POI Id
				this.obj.poiName = this.poiList[e.detail.value].poi_name; //POI地址名称
			},

			//选择设备
			bindPickerChange4(e) {

				if (this.obj.id) {
					this.$sun.toast("编辑活动不能修改绑定设备", 'none');
					return;
				}
				
				this.obj.equipmentId = this.deviceList[e.detail.value].id;
				this.obj.equipmentName = this.deviceList[e.detail.value].equipmentName;
			},

			// 上传
			imgsChange2() {
				this.$refs.selectimgandupload2.upload();
			},

			// 获取上传或者预览后的图片
			imgLoaded2(e) {
				this.obj.backgroundImage = '';
				for (let i = 0; i < e.length; i++) {
					if (i == (e.length - 1)) {
						this.obj.backgroundImage += e[i].url;
						return;
					}
					this.obj.backgroundImage += e[i].url + ',';
				}
			},

			//视频号挂载
			selSphMountType(type) {
				this.obj.sphMountType = type;
			},

			//账号信息
			async getInfo() {
				const result = await this.$http.post({
					url: this.$api.selectId,
					data: {
						id: uni.getStorageSync('merchantId'),
						types: uni.getStorageSync('types'),
					}
				});
				if (result.code == 2000) {
					this.user = result.data;
				} else {
					this.$sun.toast(result.msg, 'none');
				}
			},

			/*  阿里云设置  */
			async set() {
				const result = await this.$http.post({
					url: this.$api.userOssList,
					data: {
						username: uni.getStorageSync('merchantCode')
					}
				});
				if (result.code == 2000) {
					this.upPicUrl = result.data.domainName;
					this.formData.OSSAccessKeyId = result.data.accessKeyId;
					this.formData.policy = base64.encode(JSON.stringify(this.policyText));
					let message = this.formData.policy;
					let bytes = Crypto.HMAC(Crypto.SHA1, message, result.data.accessKeySecret, {
						asBytes: true
					});
					this.formData.signature = Crypto.util.bytesToBase64(bytes);
					// console.log("------------formData",this.formData);
				} else {
					this.$sun.toast(result.msg, 'none');
				}
			},

			//日期
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();
				if (type === 'start') {
					year = year - 100;
				} else if (type === 'end') {
					year = year;
				}
				month = month > 9 ? month : '0' + month;;
				day = day > 9 ? day : '0' + day;
				return `${year}-${month}-${day}`;
			},

		}
	}
</script>

<style lang="scss">
	
	.img-43 {}
	
	.img-43 {
		width: 80rpx;
		height: 40rpx;
		
	}
	
	.input-number {
		width: 140rpx;
		background-color: #F7F7F7;
		border-radius: 10rpx;
		padding: 10rpx 20rpx;
		margin-top: 14rpx;
	}

	.input-name {
		width: 400rpx;
		background-color: #F7F7F7;
		border-radius: 10rpx;
		padding: 10rpx 20rpx;
		margin-top: 24rpx;
	}

	.sort {
		background-color: #DDF0FF;
		color: #1E6CEB;
		text-align: center;
		padding: 4rpx 12rpx;
		margin-right: 26rpx;
	}

	.back-next {
		width: 200rpx;
		text-align: center;
		border: 1px solid #1E6CEB;
		color: #1E6CEB;
		border-radius: 2rpx;
		font-size: 32rpx;
		padding: 18rpx;
	}

	.search {
		width: 140rpx;
		text-align: center;
		background-color: #6568F6;
		color: #FFFFFF;
		padding: 20rpx;
	}

	.top {
		width: 750rpx;
		background-color: #FFFFFF;
		padding: 30rpx 92rpx;
	}

	.line {
		width: 162rpx;
		height: 4rpx;
		border-bottom: 1px dashed #D9D9D9;
		margin: 0 40rpx;
	}

	.step {
		width: 40rpx;
		height: 40rpx;
		border-radius: 100rpx;
		margin-right: 10rpx;
		text-align: center;
	}

	.two {
		background-color: #6568F6;
		color: #FFFFFF;
	}

	.one {
		color: #A1A1A1;
		border: 1px solid #D9D9D9;
	}

	.sel-date {
		width: 300rpx;
	}

	.input-frame {
		width: 366rpx;
		border: 1px solid #D9D9D9;
		padding: 20rpx 26rpx;
		border-radius: 10rpx;
	}

	.but {
		width: 610rpx;
		background: linear-gradient(180deg, #6568F6 0%, #1D6FEC 100%);
		border-radius: 2px;
		text-align: center;
		padding: 20rpx;
		font-size: 32rpx;
		font-weight: bold;
		color: #FFFFFF;
	}

	.bott {
		width: 750rpx;
		background-color: #FFFFFF;
		padding: 40rpx 70rpx 24rpx;
		position: fixed;
		bottom: 0;
		z-index: 9;
	}

	.img-19 {
		width: 32rpx;
		height: 32rpx;
		margin-left: auto;
	}

	.sel-input {
		width: 660rpx;
		border: 1px solid #D9D9D9;
		border-radius: 10rpx;
		padding: 20rpx;

		input {
			width: 560rpx;
		}
	}

	.img-17 {
		width: 36rpx;
		height: 36rpx;
		margin-right: 12rpx;
	}

	.must {
		color: red;
		margin-left: 8rpx;
	}

	/deep/ .sunui-add-list-btn-text {
		color: #c4c4c4;
		font-size: 22rpx;
	}

	/deep/ .sunui-add-list-items {
		width: 120rpx !important;
		height: 120rpx !important;
		margin-top: 0;
		margin-right: 0;
		background-color: #FFFFFF;
		border: 1px solid #c4c4c4;
	}

	/deep/ .sunui-add-list-items-img {
		width: 120rpx !important;
		height: 120rpx !important;
		margin-top: 0;
		margin-right: 0;
		// background-color: #FFFFFF;
		// border: 1px solid #c4c4c4;
	}

	/deep/ .sunui-add-list-reup {
		width: 120rpx !important;
		height: 120rpx !important;
	}

	/deep/ .sunui-add-list-img {
		width: 116rpx !important;
	}

	textarea {
		width: 662rpx;
		padding: 20rpx 0;
		height: 120rpx;
	}

	.input-box {
		width: 662rpx;
		padding: 20rpx 0;
	}

	.tabs {
		justify-content: center;
		display: flex;
		align-items: center;
		background-color: #FFFFFF;
		width: 750rpx;
		margin-bottom: 20rpx;
	}

	.uni-tab-item-title {
		color: #757575;
		font-size: 28rpx;
		padding: 30rpx 0rpx;
		margin: 0 92rpx;
		flex-wrap: nowrap;
		/* #ifndef APP-PLUS */
		white-space: nowrap;
		/* #endif */
	}

	.uni-tab-item-title-active {
		color: #6568F6;
		border-bottom: 2px solid #6568F6;
		font-weight: bold;
	}
</style>